package com.t235.gc.partners.service;

import com.t235.gc.entity.Partners;
import com.t235.gc.partners.Dao.FinancePartnersMapper;
import com.t235.gc.partners.Dao.PartnersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PartnersService {
    @Autowired
    private PartnersMapper partnersMapper;
    @Autowired
    private FinancePartnersMapper financePartnersMapper;

    public Object list(Partners par){
        return partnersMapper.selectList(par);
    }

    public Object save(Partners partners){
        return partnersMapper.insert(partners);
    }

    public Object del(Integer financeId){
        return financePartnersMapper.deleteByPrimaryKey((long)financeId);
    }

    public Object xiu(Integer partnersId){
        return partnersMapper.selectByPrimaryKey((long)partnersId);
    }

    public Object update(Partners partners){
        return partnersMapper.updateByPrimaryKeySelective(partners);
    }

    public Object jia(Integer balance,Integer financeId){
        return financePartnersMapper.updateJia(balance, financeId);
    }

    public Object jian(Integer balance,Integer financeId){
        return financePartnersMapper.updateJian(balance, financeId);
    }
}
